-- Landscape



function linedown(x, y, c)

  for i = y, height -1 do

    set_rgb(x, i, 0, 0, c)

  end

end



steps = 20

ratio = height / steps

for i = steps, 1, -1 do

  maxh = i * ratio

  h = maxh / 16 * (math.random(4) + 9)

  for x = 0, width - 1 do

    s = math.random(2)

    if s == 1 then

      h = h + 1

    else

      h = h - 1

    end

    linedown(x, height - h, (steps - i) / steps)

  end

  progress((steps - i) / steps)

end

